package cn.anc.aonicardv.module.adpter.recorder;

import android.content.Context;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import cn.anc.aonicardv.R;
import cn.anc.aonicardv.module.ui.recorder.RecorderPhotoFragment;
import cn.anc.aonicardv.module.ui.recorder.RecorderUrgentFragment;
import cn.anc.aonicardv.module.ui.recorder.RecorderVideoFragment;

/**
 * Created by yangdai on 2017/5/18.
 */

public class RecorderAlbumAdapter extends FragmentPagerAdapter {

    private Fragment fragments[] = new Fragment[3];
    private String titles[] = new String[3];
    private Context context;


    public RecorderAlbumAdapter(FragmentManager fm, Context context) {
        super(fm);
        this.context = context;

        fragments[0] = new RecorderVideoFragment();
        fragments[1] = new RecorderUrgentFragment();
        fragments[2] = new RecorderPhotoFragment();

        titles[0] = context.getString(R.string.video);
        titles[1] = context.getString(R.string.urgent);
        titles[2] = context.getString(R.string.photo);
    }

    @Override
    public Fragment getItem(int position) {
        return fragments[position];
    }

    @Override
    public int getCount() {
        return fragments.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }


}
